<template>
	<view class="nickName">
		<van-nav-bar title="昵称签名" left-arrow @click-left="onClickLeft" />
		<van-cell-group>
			<van-field left-icon='star-o' :maxlength=8 clearable :value="userName" placeholder="请输入昵称,最大10个字符" border="false"
			 label="昵称" maxlength=10 @change="userNameChange" />
			<van-field left-icon='brush-o' :value="signature" placeholder="请输入签名,最大30个字符" border="false" label="签名" @change="signatureChange"
			 :maxlength=30 />
			<van-button block custom-style="height:40px;width:80%;margin:0 auto;margin-top:40px;" type="info" @tap="submitBtn">提
				交</van-button>
		</van-cell-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userName: '',
				signature: ''
			}
		},
		methods: {
			onClickLeft() {
				uni.navigateBack({
					delta: 1
				})
			},
			userNameChange(e) {
				this.userName = e.detail;
			},
			signatureChange(s) {
				this.signature = s.detail;
			},
			submitBtn() {
				if (this.userName == '' && this.signature == '') {
					uni.showToast({
						title: '内容不能为空',
						icon: 'loading'
					})
				} else {
					uni.navigateBack({
						delta: 1
					})
				}

			}
		}

	}
</script>

<style>
</style>
